<!doctype html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/static/vendor/reset.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/wxmp/css/style.css">
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script type="text/javascript" src="/static/vendor/layui/layui.js?v=<?=env('version')?>"></script>
    <script type="text/javascript" src="/static/vendor/function.js?v=<?=env('version')?>"></script>
    <script src="/static/vendor/function.js"></script>
    <title><?=$info['title']?></title>
  </head>
  <body>
    <div class="wraper">
    <div>
    <div class="container">
      <div class="head row">
          <div class="col-3">
            <img src="<?=$info['pic']?>" />
          </div>
          <div class="col-9">
            <p><span class="name"><?=$info['name']?></span><span class="position"><?=$info['position']?></span></p>
            <p style="margin-top:5px;"><?=$info['company']?></p>
          </div>
      </div>
      <div class="connect">
        <div class="wp">
          <ul class="clearfix">
            <?php if($info['phone']):?>
            <li>
              <a class="clearfix" href="tel:<?=$info['phone']?>">
                <div class="ico">
                  <img src="/static/wxmp/images/ICON (2).png" />
                </div>
                <div class="con">
                  <p class="txt1">手机号</p>
                  <p class="txt2"><?=$info['phone']?></p>
                </div>
              </a>
            </li>
            <?php endif;?>
            <?php if($info['tel']):?>
            <li>
              <a class="clearfix" href="tel:<?=$info['tel']?>">
                <div class="ico">
                  <img src="/static/wxmp/images/ICON (6).png" />
                </div>
                <div class="con">
                  <p class="txt1">座机号</p>
                  <p class="txt2"><?=$info['tel']?></p>
                </div>
              </a>
            </li>
            <?php endif;?>
            <?php if($info['wxid']):?>
            <li>
              <div id="wxpic" style="display:none;"><img style="width:200px;" src="<?=pic($info['pic_wx'])?>" /></div>
              <a class="clearfix" href="javascript:layer.open({type:1,title: false,area:'200px',content:$('#wxpic')});">
                <div class="ico">
                  <img src="/static/wxmp/images/ICON (4).png" />
                </div>
                <div class="con">
                  <p class="txt1">微信号</p>
                  <p class="txt2"><?=$info['wxid']?></p>
                </div>
              </a>
            </li>
            <?php endif;?>
            <?php if($info['qq']):?>
            <li>
              <a class="clearfix" href="http://wpa.qq.com/msgrd?v=3&uin=<?=$info['qq']?>&site=qq&menu=yes" target="_blank">
                <div class="ico">
                  <img src="/static/wxmp/images/qq.png" />
                </div>
                <div class="con">
                  <p class="txt1">QQ号</p>
                  <p class="txt2"><?=$info['qq']?></p>
                </div>
              </a>
            </li>
            <?php endif;?>
            <?php if($info['website']):?>
            <li>
              <a class="clearfix" href="<?=$info['website']?>" target="_blank">
                <div class="ico">
                  <img src="/static/wxmp/images/ICON (3).png" />
                </div>
                <div class="con">
                  <p class="txt1">网址</p>
                  <p class="txt2"><?=$info['website']?></p>
                </div>
              </a>
            </li>
            <?php endif;?>
            <?php if($info['address']):?>
            <li>
              <?php if(is_weixin()):?>
              <a class="clearfix" href="javascript:map(<?=$info['lng']?>,<?=$info['lat']?>)">
              <?php else:?>
                <a class="clearfix" href="androidamap://navi?sourceApplication=appname&amp;poiname=fangheng&amp;lat=<?=$info['lng']?>&amp;lon=<?=$info['lat']?>&amp;dev=1&amp;style=2">
              <?php endif;?>
                <div class="ico">
                  <img src="/static/wxmp/images/ICON (1).png" />
                </div>
                <div class="con">
                  <p class="txt1">地址</p>
                  <p class="txt2"><?=$info['address']?></p>
                </div>
              </a>
            </li>
            <?php endif;?>
          </ul>
        </div>
      </div>
      <?php if($info['description']):?>
      <div class="desc" style="margin-bottom:1rem;">
        <div class="wp">
            <div class="des_title">
              简介
            </div>
            <div class="des_content">
              <?=$info['description']?>
            </div>
        </div>
      </div>
      <?php endif;?>
      <?php if($info['pics']):?>
      <div class="pics" style="margin-bottom:1rem;">
        <div class="wp">
            <div class="des_title">
              相册
            </div>
            <div class="pics_content"><?php foreach(explode(",",$info['pics']) as $v):?><img src="<?=$v?>" /><?php endforeach;?></div>
        </div>
      </div>
      <?php endif;?>
      <!-- <div class="buttom">
        <p>我是有底线的</p>
      </div> -->
    </div>
  </div>
  </body>
  <script>
  $(document).ready(function(){
    $(".con:last").css("border-bottom","none");
  });
  var url = window.location.href.split('#')[0];
  //微信jssdk
  $.ajax({
    url:"<?=url('index/index')?>",
    method:"post",
    dataType:"json",
    data:{share_url:encodeURIComponent(url)},
    success:function(res){
      wx.config(JSON.parse(res.data));
    },
  });
  wx.ready(function() {
      var obj = {
          title: "<?=$info['title']?>",
          desc: "嗨! 这是我的微信名片,点击可以联系我哟",
          link: url,
          imgUrl: "<?=pic($info['pic'])?>",
          success: function() {},
          cancel: function() {},
          fail: function (res) {
              alert(JSON.stringify(res));
          }
      };
      // 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
      wx.onMenuShareAppMessage(obj);
      // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
      wx.onMenuShareTimeline(obj);
      // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
      wx.onMenuShareQQ(obj);
      // 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
      wx.onMenuShareWeibo(obj);
      // 2.5 监听“分享到QZone”按钮点击、自定义分享内容及分享接口
      wx.onMenuShareQZone(obj);
  });
  //分享错误
  wx.error(function(err) {
    alert(JSON.stringify(err))
  });
  function map(lng,lat){
    wx.openLocation({
        latitude: lat, // 纬度，浮点数，范围为90 ~ -90
        longitude: lng, // 经度，浮点数，范围为180 ~ -180。
        name: "<?=$info['address']?>", // 位置名
        address: "<?=$info['address']?>", // 地址详情说明
        scale: 18, // 地图缩放级别,整形值,范围从1~28。默认为最大
        infoUrl: '' // 在查看位置界面底部显示的超链接,可点击跳转
    });
  }
  </script>
</html>
